var mongoose = require('mongoose');
var config = require('../config');

mongoose.connect(config.db, function (err) {
    if (err) {
        console.error('connect to %s error: ', config.db, err.message);
        process.exit(1);
    }else{
        console.log("链接数据库成功");
        var service = require('../init/initservice');
        service.onMongoConnect();
    }
});

require('./user');